package com.bw.role.controller;

import com.bw.aop.annotation.PhoneValidator;
import com.bw.role.domain.SysRole;
import com.bw.role.service.SysRoleService;
import com.bw.role.units.Result;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private SysRoleService sysRoleService;

    @RequestMapping("/list")
    public R rolelist(){
        List<SysRole> listrole = sysRoleService.listrole();
        return R.ok(listrole);
    }

    @RequestMapping("/getrole")
    public R getrole(Integer id){
        SysRole byId = sysRoleService.getById(id);
        return R.ok(byId);
    }
}
